#ifndef		OGRE_FRAMEWORK_H
#define		OGRE_FRAMEWORK_H

//////////////////////////////////////////////////////////////////////////

#include <OgreCamera.h>
#include <OgreEntity.h>
#include <OgreLogManager.h>
#include <OgreOverlay.h>
#include <OgreOverlayElement.h>
#include <OgreOverlayManager.h>
#include <OgreRoot.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreConfigFile.h>
#include <OIS/OISEvents.h>
#include <OIS/OISInputManager.h>
#include <OIS/OISKeyboard.h>
#include <OIS/OISMouse.h>

#include <SdkTrays.h>


//////////////////////////////////////////////////////////////////////////
// curtom

typedef struct SpiritCollisionType
{
	Ogre::AxisAlignedBox	AABB;
	Ogre::String			NodeName;
}SpiritCollision;

typedef struct CameraCollisionType
{
	Ogre::AxisAlignedBox	AABB;
	bool					bCollision;
}CameraCollision;


//////////////////////////////////////////////////////////////////////////

class OgreFramework : public Ogre::Singleton<OgreFramework>, OIS::KeyListener, OIS::MouseListener
{
public:
	OgreFramework();
	~OgreFramework();

	bool initOgre(Ogre::String wndTitle, OIS::KeyListener* pKeyListener = 0,
		OIS::MouseListener* pMouseListener = 0);
	
	void updateOgre(double timeSinceLastFrame);

	bool keyPressed(const OIS::KeyEvent &arg);
	bool keyReleased(const OIS::KeyEvent &arg);

	bool mouseMoved( const OIS::MouseEvent &arg );
	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );

	Ogre::Root*						m_pRoot;
	Ogre::RenderWindow*				m_pRenderWnd;
	Ogre::Viewport*					m_pViewport;
	Ogre::Log*						m_pLog;
	Ogre::Timer*					m_pTimer;

	OIS::InputManager*				m_pInputMgr;
	OIS::Keyboard*					m_pKeyboard;
	OIS::Mouse*						m_pMouse;

	OgreBites::SdkTrayManager*		m_pTrayMgr;

private:
	Ogre::String							mResourcePath;


	OgreFramework(const OgreFramework&);
	OgreFramework&	operator = (const OgreFramework &);
};
#endif